/* Enhanced Modern UI Styles for Index Page */
body {
  background-color: #f8f9fa;
  font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei", "Hiragino Sans GB", sans-serif;
  color: #333;
  line-height: 1.6;
}

a {
  color: #0088cc;
  transition: all 0.3s ease;
}

a:hover, a:focus {
  color: #005580;
  text-decoration: none;
}

/* Modern Navbar */
.navbar-modern {
  background-color: #fff;
  border: none;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.navbar-modern .navbar-brand {
  font-weight: 700;
  color: #0088cc;
  font-size: 22px;
}

.navbar-modern .nav > li > a {
  color: #505050;
  font-weight: 500;
  padding: 20px;
  transition: all 0.3s ease;
}

.navbar-modern .nav > li > a:hover,
.navbar-modern .nav > li.active > a {
  color: #0088cc;
  background-color: transparent;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #0062cc, #0088cc);
  color: white;
  padding: 30px 0;
  margin-bottom: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 136, 204, 0.3);
}

.hero-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 16px;
  font-weight: 300;
  margin-bottom: 0;
  opacity: 0.9;
}

/* Search Box */
.search-container {
  margin-bottom: 30px;
  position: relative;
}

.search-box {
  display: flex;
  background: white;
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
}

.search-input {
  flex-grow: 1;
  border: none;
  padding: 15px 20px;
  font-size: 16px;
  border-radius: 50px 0 0 50px;
  outline: none;
}

.search-input:focus {
  box-shadow: none;
}

.search-button {
  background: linear-gradient(135deg, #0062cc, #0088cc);
  border: none;
  color: white;
  padding: 0 25px;
  border-radius: 0 50px 50px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-button:hover {
  background: linear-gradient(135deg, #005ab8, #0074ad);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
  z-index: 10;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
  color: #333;
}

.search-result-item {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: rgba(0, 136, 204, 0.05);
}

.search-result-name {
  font-weight: 500;
  color: #333;
}

.search-result-price {
  color: #ff6b6b;
  font-weight: 600;
}

.search-result-action {
  margin-left: 15px;
}

/* Announcement Card */
.announcement-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.announcement-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.announcement-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, #0062cc, #0088cc);
}

.announcement-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.announcement-icon {
  background: linear-gradient(135deg, #0062cc, #0088cc);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(0, 136, 204, 0.3);
}

.announcement-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.announcement-content {
  color: #505050;
  line-height: 1.7;
}

/* Category Tabs */
.category-tabs {
  margin-bottom: 20px;
  position: relative;
}

.nav-tabs {
  border-bottom: none;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tabs > li {
  float: none;
  margin-bottom: 0;
  margin-right: 5px;
  white-space: nowrap;
}

.nav-tabs > li:last-child {
  margin-right: 0;
}

.nav-tabs > li > a {
  background-color: #f8f9fa;
  color: #666;
  border: none;
  border-radius: 20px;
  padding: 8px 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-right: 0;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  background: linear-gradient(135deg, #0062cc, #0088cc);
  color: white;
  border: none;
  box-shadow: 0 3px 10px rgba(0, 136, 204, 0.3);
}

.nav-tabs > li > a:hover {
  border-color: transparent;
  background-color: #edf5fa;
}

.tab-content {
  margin-top: 15px;
}

/* Category Card */
.category-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.category-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.category-header {
  background: linear-gradient(135deg, #0062cc, #0088cc);
  color: white;
  padding: 15px 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.category-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.category-title i {
  margin-right: 10px;
}

.category-toggle {
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.category-toggle i {
  font-size: 12px;
  transition: all 0.3s ease;
}

.collapsed .category-toggle i {
  transform: rotate(-180deg);
}

.category-body {
  padding: 0;
}

/* Product Compact List */
.product-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.product-item:last-child {
  border-bottom: none;
}

.product-item:hover {
  background-color: rgba(0, 136, 204, 0.03);
}

.product-info {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0; /* Helps with text truncation */
}

.product-name {
  font-weight: 500;
  color: #333;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.product-price {
  color: #ff6b6b;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 15px;
}

.product-unit {
  font-size: 13px;
  color: #666;
  font-weight: normal;
}

.product-action {
  margin-left: 10px;
  white-space: nowrap;
}

/* Action Buttons */
.btn-modern {
  border-radius: 20px;
  border: none;
  padding: 6px 12px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.3s ease;
  position: relative;
}

.btn-modern:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  border-radius: inherit;
}

.btn-modern:hover:before {
  width: 100%;
}

.btn-modern-primary {
  background: linear-gradient(135deg, #0062cc, #0088cc);
  color: white;
}

.btn-modern-primary:hover,
.btn-modern-primary:focus {
  background: linear-gradient(135deg, #005cb8, #0074ad);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 136, 204, 0.4);
}

.btn-modern-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.btn-modern-success:hover,
.btn-modern-success:focus {
  background: linear-gradient(135deg, #22933c, #1cb386);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(40, 167, 69, 0.4);
}

.btn-modern-danger {
  background: linear-gradient(135deg, #ff6b6b, #ff5252);
  color: white;
}

.btn-modern-danger:hover,
.btn-modern-danger:focus {
  background: linear-gradient(135deg, #ff5252, #ff3838);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(255, 107, 107, 0.4);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Cart Fixed Button */
.cart-fixed-btn {
  position: fixed;
  right: 25px;
  bottom: 25px;
  width: 60px;
  height: 60px;
  line-height: 60px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0062cc, #0088cc);
  color: white;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: all 0.3s ease;
  font-size: 24px;
}

.cart-fixed-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  color: white;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #ff6b6b;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Audio Player */
#audio-play {
  position: fixed;
  bottom: 95px;
  right: 25px;
  z-index: 999;
}

#audio-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #20c997, #28a745);
  text-align: center;
  line-height: 50px;
  color: white;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
}

#audio-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

#audio-btn:after {
  content: "\f028";
  font-family: 'FontAwesome';
}

#audio-btn.off:after {
  content: "\f026";
}

#audio-btn.on {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Modal Styles */
.modal-content {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
  background: linear-gradient(135deg, #0062cc, #0088cc);
  color: white;
  border-bottom: none;
  padding: 20px;
}

.modal-title {
  font-weight: 600;
}

.modal-body {
  padding: 25px;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 20px;
}

/* Footer */
.footer {
  margin-top: 40px;
  padding: 30px 0;
  text-align: center;
  color: #666;
}

.footer p {
  margin: 8px 0;
}

.footer-heart {
  color: #ff6b6b;
  animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.3);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(1);
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .product-name {
    max-width: 50%;
  }
  
  .nav-tabs > li > a {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .search-input {
    padding: 12px 15px;
    font-size: 14px;
  }
  
  .search-button {
    padding: 0 20px;
  }
  
  .category-header {
    padding: 12px 15px;
  }
  
  .category-title {
    font-size: 16px;
  }
  
  .product-item {
    padding: 10px 15px;
  }
}

@media (max-width: 576px) {
  .product-name {
    max-width: 40%;
  }
  
  .btn-modern {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .product-item {
    padding: 8px 12px;
  }
  
  .product-price {
    margin-right: 8px;
    font-size: 13px;
  }
}